﻿@page "/genaric-table"

<GenaricTable Data="@Users">
    <HeaderTemplate>
        <th>Id</th>
        <th>名字</th>
    </HeaderTemplate>
    <RowTemplate>
        <td>@context.Id</td>
        <td>@context.Name</td>
    </RowTemplate>
</GenaricTable>

@code {
    class User
    {
        public int Id{ get; set; }
        public string? Name { get; set; }
    }

    IEnumerable<User> Users => new List<User>
    {
        new(){ Id=1, Name="张三"},
        new(){ Id=2, Name="李四"},
        new(){ Id=3, Name="王五"},
        new(){ Id=4, Name="赵六"}
    };
}
